// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
// 引入elementUI
import elementUI from 'element-ui'
// 引入element样式表
import 'element-ui/lib/theme-chalk/index.css'
// 引入公共样式
import "./assets/common.css"
// 引入axios
import axios from 'axios'
// 引入字体图标
import './assets/fonts/iconfont.css'
// 引入树形结构组件
import TreeTable from 'vue-table-with-tree-grid'
// 引入富文本插件
import VueQuillEditor from 'vue-quill-editor'
//导入vue-quill-editor的样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
//全局注册富文本组件
Vue.use(VueQuillEditor)

Vue.config.productionTip = false
    // 全局基础设置
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
    // 请求拦截器
axios.interceptors.request.use(config => {
        config.headers.Authorization = window.sessionStorage.getItem("token")
        return config
    })
    // 响应拦截器
axios.interceptors.response.use(info => {
        return info.data
    })
    //全局注册组件
Vue.component('tree-table', TreeTable)

Vue.prototype.$axios = axios



Vue.use(elementUI)
    /* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    components: { App },
    template: '<App/>'
})